<?php
	if (isset($_SESSION['adminPassed']))
	{
?>
		<span>你已经登录过.</span>
<?php
	}
	else if (isset($_POST['adminName']))
	{
		switch (adminLogin($_POST['adminName'], $_POST['adminPwd']))
		{
			case 1:
?>
				<span>登录失败</span><br />
				<div id="content">
					<div class="tabs headTabs">管理登录 </div>
					<div class="dataList">
						<form action='?p=login' method='post' id='loginForm' class='inputbox'>
							<label>用户名 </label>
							<input type="text" name="adminName" class="loginInput" />  
							<label> 密码  </label>
							<input type="password" name="adminPwd" class="loginInput" />  
							<input type="submit" value="提交" class="button" />
							<input type="reset"	value="重置" class="button" />
						</form>
					</div>
				</div>
<?php
				break;
			default:
?>
				<meta http-equiv='refresh' content='0.1;url=<?php echo ADMINURL;?>index.php'>
<?php
		}
	}
	else 
	{
?>
		<div id="content">
			<div class="tabs headTabs">管理登录 </div>
			<div class="dataList">
				<form action='?p=login' method='post' id='loginForm' class='inputbox'>
					<label>用户名 </label>
					<input type="text" name="adminName" class="loginInput" />  
					<label> 密码  </label>
					<input type="password" name="adminPwd" class="loginInput" />  
					<input type="submit" value="提交" class="button" />
					<input type="reset"	value="重置" class="button" />
				</form>
			</div>
		</div>
<?php
	}
?>